//
//  BaseViewController.m
//  WalkUp
//
//  Created by 李沛池 on 16/10/24.
//  Copyright © 2016年 LPC. All rights reserved.
//

#import "BaseViewController.h"
#import "LPCDefine.h"


@interface BaseViewController ()<
UIGestureRecognizerDelegate>

@end

@implementation BaseViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self initData];
    [self initUI];
}

-(void)viewWillAppear:(BOOL)animated{
    //开启ios右滑返回
    if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
        self.navigationController.interactivePopGestureRecognizer.delegate = self;
    }
    
    //更新数据
    [self updateData];
    
    NSLog(@"vcName : %@",[self.class description]);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
    NSLog(@"didReceiveMemoryWarning : %@",[self.class description]);
}

#pragma mark - Init
//初始化数据
- (void)initData
{
    
}

//初始化UI
- (void)initUI
{
    self.view.backgroundColor = KColorBackgroundColor;
}

//更新数据
- (void)updateData
{
    
}

#pragma mark - UIGestureRecognizerDelegate
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
    if (self.navigationController.viewControllers.count == 1)//关闭主界面的右滑返回
    {
        return NO;
    }
    else
    {
        return YES;
    }
}


@end
